Regular Expression Tester

Write, test, and debug your JavaScript regular expressions in real-time. See matches and capture groups as you type.

/ /

            
No matches found yet.

About The Regular Expression Tester

A Regular Expression (or Regex) is a sequence of characters that specifies a search pattern in text. This tool allows you to test your JavaScript-compatible regular expressions against a sample text, providing instant visual feedback by highlighting all matches and listing the captured groups.

Common Flags

  • g (Global): Finds all matches instead of stopping after the first one.
  • i (Case-Insensitive): Makes the expression case-insensitive (e.g., /a/i would match "a" and "A").
  • m (Multiline): Allows start (^) and end ($) anchors to match at the beginning and end of each line, not just the whole string.
  • s (Dot All): Allows the dot (.) to match newline characters as well.

How to Use This Tool:

  1. Enter Your Regex: Type your regular expression pattern in the input field between the slashes /.../.
  2. Select Flags: Check the boxes for any flags (like global or case-insensitive) you want to apply.
  3. Provide Test String: Paste or type the text you want to test your expression against in the larger text area.
  4. See Instant Results: As you type, the tool will automatically:
    • Highlight all matching parts of your test string.
    • List all the matches and their capture groups in the panel below.
  5. Debug: If your expression is invalid, an error message will appear in the results panel.